package com.xbongbong.paas.field;

import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

/**
 * @author: wufeng
 * @date: 2018/8/14 18:02
 * @desrcption: 公式对象
 */
@Setter
@Getter
@ToString
public class FormulaPoJo implements Serializable {
    private static final long serialVersionUID = -3515848086895722883L;

    /**
     * 公式表达式"{self.num_1}*{self.num_2}*{120.num_3}" / "ADD({self.num_1}, {self.num_2}, {self.num_3})"
     */
    @NotEmpty(message = "{pojo.msg.FormulaPoJo.formula.NotEmpty}")
    private String formula;

    /**
     * 存对应字段的中文解释
     * 普通数据格式：{"self.text_1": "数据/字段标题", "表单id.text_1":"数据/字段标题"}
     * 工单数据格式：{"workOrder.表单id.text_1":"数据/字段标题"}
     */
    private JSONObject labelMap;


    private String text;
}
